<style type="text/css">
    .dimmers {
        margin-top: 55px !important;
        background-color: rgba(0, 0, 0, .99) !important;
    }
    .PicDiv{
        border: 1px solid LightGrey; overflow:hidden; min-height:156px; padding-top:10px; padding-left:10px;
    }
    .no-hover {
        color: black;
        cursor:default;
    }
    #payeeID .ui.dropdown.selection{
        width: 290px;
    }
    .label_fl{ float: left; margin-right: 1em; line-height: 32px;}
</style>
<!--内容区开始-->
<div class="cont">
    <div class="position">
        <img alt="位置图标" src="dist/images/position.png">财务管理&gt;查账流水
        <a ng-click="openDetail('',index_key)" ng-hide="$needClientCache" title="打开新窗口查看"><i class="large External icon"></i></a>
    </div>
    <div class="mybackground">
        <div class="cont_fr_top">
            <div class="menus_top">
                <div class="menus_l">审核状态:</div>
                <ul id="nav">
                    <li ng-if="search_param.audit == -1"  class="selected"><a>全部</a></li>
                    <li ng-if="search_param.audit != -1"  ><a ng-click="search_param.audit=-1">全部</a></li>
                    <li ng-if="search_param.audit == 0"  class="selected"><a>待审核</a></li>
                    <li ng-if="search_param.audit != 0"  ><a ng-click="search_param.audit=0">待审核</a></li>
                    <li ng-if="search_param.audit == 1"  class="selected"><a>成功</a></li>
                    <li ng-if="search_param.audit != 1"  ><a ng-click="search_param.audit=1">成功</a></li>
                    <li ng-if="search_param.audit == 2"  class="selected"><a>失败</a></li>
                    <li ng-if="search_param.audit != 2"  ><a ng-click="search_param.audit=2">失败</a></li>
                </ul>
            </div>
            <div class="menus">
                <div class="menus_con ui form">
                    <div class="four fields">
                        <div class="inline field">
                            <label>综合查询</label>
                            <input type="text" ng-model="search_param.customer_name" ng-keyup="enterSearch($event)"  placeholder="姓名/电话" style="width: 160px" >
                        </div>
                        <div class="inline field">
                            <label>业务人员</label>
                            <input type="text" ng-model="search_param.sales" ng-keyup="enterSearch($event)"   placeholder="业务人员" maxlength="15" style="width: 160px"  >
                        </div>
                    <div class="inline field">
                        <label>付款时间</label>
                        <div class="ui left icon input">
                            <input ng-model="search_param.stime"  placeholder="开始时间" datetimepicker="" format="YYYY-MM-DD" id="firstTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                    <div class="inline field">
                        <div class="ui left icon input">
                            <input ng-model="search_param.etime" placeholder="结束时间" datetimepicker="" format="YYYY-MM-DD" id="secondTime" style="width:160px;height: 32px" >
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                </div>
                <div class="four fields">
                      <div class="inline field">
                        <label class="fl" style="margin-right:2.2em">付款人</label>
                        <input type="text" ng-model="search_param.pay_name" ng-keyup="enterSearch($event)"   placeholder="付款人" maxlength="15" style="width:160px" >
                    </div>
                    <div class="inline field">
                        <label class="fl">付款方式</label>
                        <div class="ui left icon input">
                            <select  ng-model="search_param.pay_way" class="ui dropdown" ng-keyup="enterSearch($event)"  >
                                  <option value="-1" ng-selected="'-1'==search_param.pay_way||''==search_param.pay_way"  >全部</option>
                                  <option ng-selected="vp.k==search_param.pay_way"  ng-repeat="vp in pageParam.payways" value="{{vp.k}}">{{vp.v}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="inline field">
                        <label style="margin-right: 2.8em;">状态</label>
                        <select ng-model="search_param.status" class="ui dropdown"   ng-keyup="enterSearch($event)" >
                              <option value="0"  ng-selected="0==search_param.status"  >全部</option>
                              <option value="1"  ng-selected="1==search_param.status">有效</option>
                              <option value="2"  ng-selected="2==search_param.status">作废</option>
                        </select>
                    </div>
                </div>
                <div class=" fields">
                    <div class="inline field">
                        <button class="clear_btn" ng-click="search()" style="margin-left: 4.5em"> 查找</button>
                    </div>
                    <div class="inline field">
                        <button class="clear_btn" ng-click="export_s()" style="padding: 0 18px;">查账导出</button>
                    </div>
                </div>
            </div>
        </div>
      </div>
    </div>
    <div class="ui bottom attached tab segment active" data-tab="first" style=" border: none">
        <div class="menus" >
            <div class="menus_table"><!--表格-->
            <table class="ui column table">
              <thead>
                <tr>
                    <th>申请时间</th>
                    <th>查账申请人</th>
                    <th>客户姓名</th>
                    <th>订购产品</th>
                    <th>付款人</th>
                    <th>付款方式</th>
                    <th>付款金额</th>
                    <th>到账时间</th>
                    <th>服务人员</th>
                    <th>备注</th>
                    <th>查账类型</th>
                    <th>是否作废</th>
                    <th>是否撞单</th>
                    <th>开发票</th>
                    <th>处理</th>
                </tr>
              </thead>
              <tbody ng-show="moneypage.pageAll >= 1">
               <tr ng-repeat="mon in money">
                    <td>{{mon.create_time}}</td>
                    <td>{{mon.createname}}</td>
                    <!--Wjw 20170707 修改浮窗-->
                    <td ng-show ="mon.pay_type != 1"><div float_layer customer-id='mon.customer_id' show-name="mon.nickname"></div></td>
                    <td ng-show ="mon.pay_type == 1"><div float_layer customer-id='mon.customer_id' show-name="mon.customer_name"></div></td>
                    <!--修改浮窗结束-->

                    <td>{{mon.name}}</td>
                    <td>{{mon.pay_name}}</td>
                    <td>{{mon.pay_way}}</td>
                    <td>{{mon.pay_mount}}</td>
                    <td>{{mon.pay_time|limitTo:10}}</td>
                    <td>{{mon.username}}</td>
                    <td>{{mon.remark}}</td>
                    <td>
                        <!-- <span ng-if = " mon.pay_type == 0">未知</span> -->
                        <span ng-if="mon.pay_type !=1 && mon.pay_type != 2 && mon.pay_type != 3">未知</span>
                        <span ng-if = " mon.pay_type == 1">新单</span>
                        <span ng-if = " mon.pay_type == 2">续费</span>
                        <span ng-if = " mon.pay_type == 3">退款</span>
                    </td>
                    <td>
                        <span ng-if="mon.record_status == 1" style="color:green;">有效</span>
                        <span ng-if="mon.record_status == 2" style="color:gray;">作废</span>
                    </td>
                    <td>
                        <span ng-if="mon.is_conflict==1" style="color:red;"> 撞单</span>
                        <span ng-if="mon.is_conflict==0">否</span>
                    </td>
                    <td>
                        <a ng-show="mon.audit_res == 1 && mon.pay_name && mon.invoice_mount<1" rel="{{mon.customer_id}}" ng-click="addinvoice()">添加发票</a>
                        <a ng-show="mon.audit_res != 1 || !mon.pay_name || mon.invoice_mount>0" style="text-decoration:none;">
                            <span class="no-hover">不可添加</span>
                        </a>
                    </td>
                    <td ng-if = "mon.audit_res == 2" style="padding-top:0px;padding-bottom:0px;">
                    <span ng-if=" mon.pay_type != 3">
                        <a href="javascript:;" title="编辑退款查账信息"  ng-click="verify(mon['payrecord_id'],mon['contract_id'])" ng-show = "mon.audit_res == 0">
                           <img alt="编辑方式图标" src="dist/images/edit.png">
                        </a>
                        <span ng-show="mon.audit_res == 1 " style="color:green;">
                            已处理
                        </span>
                        <span ng-show="mon.audit_res == 2 " style="color:red;">
                            失败 <p>{{mon.audit_msg}}</p>
                        </span>
                    </span>
                    <span ng-if=" mon.pay_type == 3">
                        <a href="javascript:;" title="编辑退款查账信息" ng-click="verify_reback()" ng-show = "mon.audit_res == 0">
                            <img alt="编辑方式图标" src="dist/images/edit.png">
                        </a>
                        <span ng-show="mon.audit_res == 1 " style="color:green;">
                            已处理
                        </span>
                        <span ng-show="mon.audit_res == 2 " style="color:red;">
                            失败
                            {{mon.audit_msg}}
                        </span>
                    </span>
                    </td>
                    <td ng-if = "mon.audit_res != 2" style="padding-top:0px;padding-bottom:0px;">
                    <span ng-if=" mon.pay_type != 3">
                        <a href="javascript:;" title="编辑退款查账信息"  ng-click="verify(mon['payrecord_id'])" ng-show = "mon.audit_res == 0">
                           <img alt="编辑方式图标" src="dist/images/edit.png">
                        </a>
                        <span ng-show="mon.audit_res == 1 " style="color:green;">
                            已处理
                        </span>
                        <span ng-show="mon.audit_res == 2 " style="color:red;">
                            失败 <p>{{mon.audit_msg}}</p>
                        </span>
                    </span>
                    <span ng-if=" mon.pay_type == 3">
                        <a href="javascript:;" title="编辑退款查账信息" ng-click="verify_reback()" ng-show = "mon.audit_res == 0">
                            <img alt="编辑方式图标" src="dist/images/edit.png">
                        </a>
                        <span ng-show="mon.audit_res == 1 " style="color:green;">
                            已处理
                        </span>
                        <span ng-show="mon.audit_res == 2 " style="color:red;">
                            失败
                            {{mon.audit_msg}}
                        </span>
                    </span>
                    </td>
                </tr>
              </tbody>
                <tbody ng-show="moneypage.pageAll < 1">
                  <tr>
                    <td colspan="10" style="color:red;">
                         <p style="text-align:center;">没有找到数据~~~</p>
                    </td>
                  </tr>
                </tbody>
            </table>
            <tfoot>
            <tr>
                <th colspan="8">
                    <div class="ui pagination menu" jspagination   page-object="moneypage" page-func="getDataList"  ng-show="moneypage&&moneypage.pageAll>1" ></div>
                </th>
            </tr></tfoot>
            </div>
            <!--分页-->
        </div>
    </div>
    <div class="ui bottom attached tab segment" data-tab="second" style=" border: none">
            <div class="menus_con" style="position: absolute;top:15px;">
                <ul style="padding-left:0px;">
                    <li >
                        <label for="textfield" class="li_lable">开始时间</label>
                        <div class="ui left icon input">
                        <input type="text" placeholder="开始时间" ng-model="start_time_static"  onclick="laydate({istime: true, format: 'YYYY-MM-DD'})"  value="" id="s_static">
                        <i class="calendar icon"></i>
                        </div>
                    </li>
                    <li>
                        <label for="textfield" class="li_lable" >结束时间</label>
                        <div class="ui left icon input">
                        <input type="text" placeholder="结束时间" ng-model="end_time_static" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" value="" id="e_static">
                        <i class="calendar icon"></i>
                        </div>
                    </li>
                    <li>
                        <label for="select" class="li_lable">业绩分类</label>
                        <select name="T_static" id="T_static" class="select_text2" style=" border-radius:3px;"  >
                              <option value="" selected disabled hidden>业绩分类</option>
                              <option value="1">员工业绩</option>
                              <option value="2">部门业绩</option>
                        </select>
                    </li>
                     <a ng-click="search_static()">查找</a>
                </ul>
            </div>
    <div class="menus_table" style="position: absolute;top:80px;">
      <table class="ui column table" style="border-top: 3px solid #cba221;">
        <thead>
          <tr>
            <th style="text-align:center;">名称</th>
            <th style="text-align:center;">实际业绩</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="_statis in statistics">
            <td>
              <div class="ui ribbon label">{{_statis.sector_name}}</div>
              <!-- <div>{{_statis.sector_name}}</div> -->
            </td>
            <td>
                <div>{{_statis.pay_mount}}</div>
            </td>
          </tr>
          <tr ng-show="!statisticspage.pageAll">
            <td colspan="13">
              <h2 style="text-align: center;">没有找到符合条件的记录!</h2>
            </td>
          </tr>
        </tbody>
        <tfoot ng-show="statisticspage.pageAll >1">
          <tr>
            <th colspan="13">
              <div class="ui pagination menu" jspagination  page-object="statisticspage" page-func="search_static"></div>
            </th>
          </tr>
        </tfoot>
      </table>
     </div>
    </div>
 </div>
 <!--内容区结束-->

<!--确认删除-->
<div class="ui refuse_audit modal">
    <div class="header" style="text-align: center;">拒绝审核信息</div>
    <div class="content" style="text-align: center;">
        <i class="huge blue help circle icon"></i>
        <p style="padding-top: 15px;">确认拒绝该条审核信息吗?</p>
    </div>
    <div class="actions" style="text-align: center;">
        <button class="ui green button positive" ng-click="refuse_audit()">确认</button>
        <button class="ui grey button negative">取消</button>
    </div>
</div>

 <!--弹框开始-->
 <script type="text/javascript">
$('.menu .item')
  .tab();

$(function(){
    $('.ui.dropdown').dropdown();
    $("#nav li").click(function(){
       $(this).addClass('selected').siblings().removeClass('selected');
    });
    $('#verifyID').form({
    on: 'blur',
    inline : true,
        fields: {
            info: {
                identifier: 'info',
                rules: [
                    {
                        type   : 'empty',
                        prompt : '审核信息不能为空'
                    }
                ]}
        }
    });
    $('#verify_re_back').form({
    on: 'blur',
    inline : true,
        fields: {
            paytype_rbk: {
                identifier: 'paytype_rbk',
                rules: [
                    {
                        type   : 'empty',
                        prompt : '付款方式不能为空'
                    }
                ]},
            info_rbk: {
                identifier: 'info_rbk',
                rules: [
                    {
                        type   : 'empty',
                        prompt : '备注信息不能为空'
                    }
                ]}
        }
    });
    //添加普通发票
    $('#frm-add').form({
        on: 'blur',
        inline : true,
        fields: {
            title: {
            identifier: 'title',
            rules: [
                {
                    type   : 'empty',
                    prompt : '发票抬头不能为空'
                },
                {
                    type   : 'maxLength[50]',
                    prompt : '发票抬头最多为50个字'
                }
            ]},
            money:{
            identifier: 'money',
            rules: [
                {
                    type   : 'empty',
                    prompt : '发票金额不能为空'
                },
                {
                    type   : 'number',
                    prompt : '发票金额必须为数字'
                }
            ]},
            remark:{
            identifier: 'remark',
            rules: [
                {
                    type   : 'maxLength[100]',
                    prompt : '备注信息最多为100个字'
                }
            ]},
        }
    });
    //添加发票邮寄记录
    $('#delivery-add').form({
        on: 'blur',
        inline : true,
        fields: {
        recipients: {
            identifier: 'recipients',
            rules: [
                {
                    type   : 'empty',
                    prompt : '收件人不能为空'
                },
                {
                    type   : 'maxLength[20]',
                    prompt : '收件人最多为20个字'
                }
            ]},
            address: {
            identifier: 'address',
            rules: [
                {
                    type   : 'maxLength[100]',
                    prompt : '邮寄地址最多为100个字'
                }
            ]},
            remark:{
            identifier: 'remark',
            rules: [
                {
                    type   : 'maxLength[100]',
                    prompt : '备注信息最多为100个字'
                }
            ]},
        }
    });
    //添加专票
    $('#frm-imgPost').form({
        on: 'blur',
        inline : true,
        fields: {
            imgPost_title: {
            identifier: 'imgPost_title',
            rules: [
                {
                    type   : 'empty',
                    prompt : '发票抬头不能为空'
                }
            ]},
            imgPost_money:{
            identifier: 'imgPost_money',
            rules: [
                {
                    type   : 'empty',
                    prompt : '发票金额不能为空'
                },
                {
                    type   : 'number',
                    prompt : '发票金额必须为数字'
                }
            ]},
        }
    });
});

</script>

 <!-- 弹框开始 -->
<div class="ui pay modal">
<i class="close icon"></i>
    <div class="header">
        查账导出
    </div>
    <div class="image content">
        <form class="ui form" name="export" id="export" style="width:850px;">
        <table class="ui column table" style="border-top: 3px solid #cba221;">
        <tr>
            <td style="width:100px;text-align:center;font-weight:bold;">查账时间：</td>
            <td>
                <div class="field">
                <div class="ui left icon input">
                    <input type="text"  onclick="laydate({istime: true, format: 'YYYY-MM-DD'})"  ng-model="createtime" placeholder="开始时间"  value="" name="createtime" id="createtime">
                    <i class="calendar icon"></i>
                </div>
                </div>
            </td>
             <td colspan="2">
              <div class="field">
                <div class="ui left icon input">
                <input type="text"  onclick="laydate({istime: true, format: 'YYYY-MM-DD'})"  ng-model="endtime" placeholder="结束时间"  value="" name="endtime" id="endtime">
                <i class="calendar icon"></i>
                </div>
              </div>
            </td>
        </tr>
        <tr>
            <td style="font-weight:bold;">查账人：</td>
            <td colspan="3">
            <div class="field" style="display:inline;margin-left:0px;">
                  <div class="ui selection dropdown" id="creatorfrm">
                    <input type="hidden" name="creator" id="creator"  value="">
                    <i class="dropdown icon"></i>
                    <div class="default text" id="default_txt"></div>
                    <div class="menu">
                      <div class="item" ng-repeat="sec in user" data-value="{{sec.user_id}}">{{sec.nickname}}</div>
                    </div>
                  </div>
            </div>
            </td>
        </tr>
        </table>
        <div style="text-align:center;">
                <button  id="Excel" class="btn" ng-click="export_r()" >导出Excel</button>
        </div>

        </form>
  </div>
</div>

<div class="ui verify modal">
  <i class="close icon"></i>
  <div class="header_h4">
   查账审核
  </div>
  <div class="content">
    <div class=" form">
        <form class="ui form" name="verifyID" id="verifyID" style="width:850px;">
            <input type="hidden" name="payrecord_id" id="payrecord_id">
            <div class="content">
                <div class="ui form">
                    <form>
                        <div class="ui segment">
                            <div><b>付款信息：</b></div>
                            <div class="two fields" style="margin-left:2em">
                                <div class="field">
                                    <span>付款人 :  </span> {{ mon.pay_name }}
                                </div>
                                <div class="field">
                                    <span>付款金额 :  </span> {{ mon.pay_mount }}
                                </div>
                                <div class="field">
                                    <span>付款方式 : </span> {{ mon.pay_way }}
                                </div>
                                <div class="field">
                                    <span>付款时间 : </span> {{ mon.pay_time }}
                                </div>
                            </div>
                            <div class="four fields"></div>
                            <div class="four fields" style="margin-left:2em" >
                                <label style="margin-left:0.5em">备注信息 :</label>
                                <input type="text"  value="" ng-model="mon.remark" style="width:88%;margin-left:1em;margin-top:-5px" disabled>
                            </div>
                            <hr size=1 style="color: gray;border-style:dotted;margin-top:6px;" ng-show="related_messge">   
                            <div ng-show="related_messge"><b>相关流水：</b></div>
                            <table class="ui celled table" ng-hide="mail_record" ng-show="related_messge">
                                <thead>
                                    <tr>
                                        <th> 付款人 </th>
                                        <th> 付款金额 </th>
                                        <th> 付款方式 </th>
                                        <th> 付款时间 </th>
                                        <th> 审核状态 </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="v in related">
                                        <td> {{ v.pay_name }} </td>
                                        <td> {{ v.pay_mount }} </td>
                                        <td> {{ v.pay_way }} </td>
                                        <td> {{ v.pay_time }} </td>
                                        <td>
                                            <div ng-switch="v.audit_res">
                                                <div ng-switch-when="1">已审核 </div>
                                                <div ng-switch-when="2">需重新审核 </div>
                                                <div ng-switch-default> 待审核 </div>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="margin-bottom:6px;"><b>审核说明：</b></div> 
                            <div class="field required" style="display:inline;margin-top:10px;">
                                <textarea name="info" id="info" placeholder="审核说明" style="width:100%;height:10%" ng-model = "info"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="actions">
                <div class="center">
                    <div class="ui pop_btn_qd positive">通过</div>
                    <div class="ui pop_btn_qx "  ng-click ="refuse()">拒绝</div>
                </div>
            </div>
        </form>
    </div>
</div>
</div>


<!-- 退款查账审核界面 -->
<div class="ui aa modal">
  <i class="close icon"></i>
  <div class="header_h4">
   退款审核
  </div>
  <div class="content">
    <div class=" form">
        <form class="ui form" name="verify_re_back" id="verify_re_back" style="width:850px;">
        <input type="hidden" name="payrecord_id_rbk" id="payrecord_id_rbk">
         <table class="ui column table" style="border-top: 3px solid #cba221;">
        <input type="hidden" name="payrecord_id" id="payrecord_id">
        <tr>
            <td style="width:100px;text-align:center;font-weight:bold;">付款信息：</td>
            <td colspan="8">
                <div class="field" style="display:inline;margin-left:0px;">
                 <textarea name="record_rb" id="record_rb" placeholder="付款信息" style="width:100%" ng-model = "record_a" ng-disabled = "true">
                 </textarea>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <div class="ui attached message" ng-if="Audit_return == 1">
                 审核记录：{{V_auditmsgReturn}}
                </div>
            </td>
        </tr>
        <tr>
            <td style="width:100px;text-align:center;font-weight:bold;">备注信息:</td>
            <td colspan="8">
                <div class="field">
                <input type="text" placeholder="备注信息" name="note_rb" id="note_rb" ng-model="note_rbk" style="width:100%" ng-disabled = "true">
                </div>
            </td>
        </tr>
        <tr>
            <td style="width:100px;text-align:center;font-weight:bold;">退款金额:</td>
            <td colspan="3">
                <div class="field">
                <input type="text" placeholder="退款金额" name="note_rb" id="note_rb" style="width:100%" ng-disabled = "true" ng-model = "pay_mount_rbk">
                </div>
            </td>
            <td style="width:100px;text-align:center;font-weight:bold;">付款方式:</td>
            <td colspan="3">
                <div class="field required">
                    <div class="ui selection dropdown" style="width: 163px;">
                        <input type="hidden" name="paytype_rbk" id="paytype_rbk">
                        <div class="default text">请选择付款方式</div>
                            <i class="dropdown icon"></i>
                            <div class="menu">
                                <div class="item" data-value="{{vp.k}}" ng-repeat="vp in pageParam.payways">{{vp.v}}</div>
                            </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="font-weight:bold;">审核说明：</td>
            <td colspan="8">
                <div class="field required" style="display:inline;margin-left:0px;">
                 <textarea name="info_rbk" id="info_rbk" placeholder="审核说明" style="width:100%" ng-model = "info_rbk"></textarea>
                </div>
            </td>
        </tr>
        </table>
        <!-- <div style="text-align:right;"> -->
            <div class="actions" >
                <div class="center">
                    <div class="ui pop_btn_qd positive">确定</div>
                    <div class="ui pop_btn_qx "  ng-click ="verify_reback_refuse()">拒绝</div>
                </div>

            </div>
        <!-- </div> -->

        </form>
    </div>
</div>
</div>

<!-- 系统信息弹出层 is ending here-->
<div class="ui systemerror modal transition ">
    <div class="header_h4 ">系统提示</div>
    <div class="content ">
        <div class="inline fluid fields ">
            <div class="field " style="display: inline-block;width: 5%; " ng-show="mongeyrcode == 1 ">
                <i class="thumbs up large icon "></i>
            </div>
            <div class="field " style="display: inline-block;width: 5%; " ng-show="mongeyrcode == 0 ">
                <i class="thumbs down large icon "></i>
            </div>
            <div class="field " style="display: inline-block;">
                <p>{{moneyMsg}}</p>
            </div>
        </div>
        <div class="actions " style="padding:14px; ">
            <div class="center " style="margin-bottom:10px; ">
                <div class="ui pop_btn_qx negative ">关闭</div>
            </div>
        </div>
    </div>
</div>
<!-- 系统信息弹出层 is ending here-->
<!--*******************************添加发票功能begin****************************************************-->
<!-- 上传图片错误信息弹出层 -->
<div class="ui small second modal" style="text-align: center">
    <div class="header">系统提示</div>
    <div class="content">
        <i class="green success circle huge icon" ng-show="mongeyrcode==1"></i>
        <i class="red warning circle huge icon" ng-show="mongeyrcode==0"></i>
        <p>{{moneyMsg}}</p>
    </div>
    <div class="actions">
        <div class="ui button positive">关闭</div>
    </div>
</div>
<!-- 添加发票 -->
<div class="ui first modal addInvoice" id="add_invoice">
    <i class="close icon"></i>
    <div class="header_h4">
        添加发票
    </div>
    <div class="content">
        <div class="ui form">
            <div class="inline fields">
                <div class="field" style="width:50%">
                    <label style="margin-left: 0.5em;">付款人：</label>
                    <input type="hidden" ng-model="invoice_payrecord_id">
                    <span>{{invoice_pay_name}}</span>
                </div>
            </div>
            <!-- 客户付款、发票信息存在 -->
            <div class="ui attached message" ng-if="customerVerify == 1">
                <div class="inline fluid fields" ng-show="payrecord_rcode==1">
                    <div class="field" style="width:50%">
                        <label style="margin-left: 0.5em;">付款信息:</label>
                    </div>
                    <div class="field" style="width:50%">
                        <label>付款总金额:</label>
                        <span>{{total_paymount}}元</span>
                    </div>
                </div>
                <div>
                    <table class="ui celled striped table">
                        <thead>
                            <tr>
                                <th>
                                    <!-- <input class="check_all" id="check_allAdd" type="checkbox"/> -->
                                </th>
                                <th>业务员</th>
                                <th>订购产品</th>
                                <th>付款人</th>
                                <th>客户名</th>
                                <th>电话号码</th>
                                <th style="width:105px;">付款金额(元)</th>
                                <th>打款时间</th>
                                <th>状态</th>
                                <th>发票情况</th>
                                <th style="width:105px;">开票金额(元)</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="vpayrecord in payrecordInfo">
                                <td>
                                    <input type="checkbox" class="check_list" name="chbidsAdd" value="{{vpayrecord.pay_id}}" ng-click="getCusPayInfo()" ng-disabled="vpayrecord.invoiceExist=='1'"/>
                                </td>
                                <td>{{vpayrecord.service_name}}</td>
                                <td>{{vpayrecord.product_name}}</td>
                                <td>{{vpayrecord.pay_name}}</td>
                                <td>{{vpayrecord.customer_name}}</td>
                                <td>{{vpayrecord.phone}}</td>
                                <td style="text-align: right">{{vpayrecord.pay_mount}}</td>
                                <td>{{vpayrecord.pay_time}}</td>
                                <td ng-if="vpayrecord.audit_res=='0'">待审核</td>
                                <td ng-if="vpayrecord.audit_res=='1'">审核成功</td>
                                <td ng-if="vpayrecord.audit_res=='2'">审核失败</td>
                                <td ng-if="vpayrecord.invoiceExist=='1'">已开</td>
                                <td ng-if="vpayrecord.invoiceExist=='0'">未开</td>
                                <td style="text-align: right">{{vpayrecord.invoice_mount}}</td>
                            </tr>
                        </tbody>
                        <tbody ng-show="payrecord_rcode!=1">
                            <tr ng-show="!busy">
                                <td colspan="9" style="text-align:center;margin-top:10px" class="null_data">没有找到数据~~~</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="field">
                    <div id="selectPaysAdd"></div>
                </div>
                <div class="inline fluid fields" ng-show="invoice_rcode==1" style="margin-top:10px;">
                    <div class="field" style="width:50%">
                        <label style="margin-left: 0.5em;">历史发票信息:</label>
                    </div>
                    <div class="field" style="width:50%">
                        <label>发票总金额:</label>
                        <span>{{total_money}}元</span>
                    </div>
                </div>
                <div>
                    <table class="ui celled striped table" ng-show="invoice_rcode==1">
                        <thead>
                            <tr>
                                <th>开票时间</th>
                                <th>发票抬头</th>
                                <th style="width:120px;">发票总金额(元)</th>
                                <th>业务人员</th>
                                <th>发票类型</th>
                                <th>邮寄状态</th>
                            </tr>
                        </thead>
                        <tbody >
                            <tr ng-repeat="vinvoice in invoiceInfo">
                                <td>{{vinvoice.create_time}}</td>
                                <td>{{vinvoice.title}}</td>
                                <td style="text-align: right">{{vinvoice.money}}</td>
                                <td>{{vinvoice.nickname}}</td>
                                <td ng-if="vinvoice.type==1">普通发票</td>
                                <td ng-if="vinvoice.type==2">专票</td>
                                <td ng-if="vinvoice.deliStatus==10">待邮寄</td>
                                <td ng-if="vinvoice.deliStatus==20">确认邮寄</td>
                                <td ng-if="vinvoice.deliStatus==30">邮寄中</td>
                                <td ng-if="vinvoice.deliStatus==40">邮寄完成</td>
                                <td ng-if="vinvoice.deliStatus==50">自取</td>
                            </tr>
                        </tbody>
                        <tbody ng-show="invoice_rcode!=1">
                            <tr ng-show="!busy">
                                <td colspan="6" style="text-align:center;margin-top:10px" class="null_data">没有找到数据~~~</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- 客户付款、发票信息不存在 -->
            <div class="ui attached message" ng-if="customerVerify == 2">
                <div class="inline fluid fields">
                    <div style="text-align:center;margin-top:10px">没有找到给客户相关付款、发票数据~~~</div>
                </div>
            </div>
            <div class="ui form">
                <div class="inline fields" style="margin-top:15px;">
                    <div class="field required">
                        <label>请选择发票类型</label>
                    </div>
                    <div class="field">
                        <div class="ui radio checkbox">
                            <input name="frequency1" checked="checked" type="radio" ng-click="switchType(1)">
                            <label>普通发票</label>
                        </div>
                    </div>
                    <div class="field" style="margin-left: 50px;">
                        <div class="ui radio checkbox">
                            <input name="frequency1" type="radio" ng-click="switchType(2)">
                            <label>专票</label>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <div id="selectType"></div>
                </div>
                <!-- 添加普通发票信息  -->
                <div class="type" ng-show="invoicetype == 1" style="min-height: 130px;">
                    <form action="#" name="frm-add" id="frm-add">
                        <div class="fields" style="margin-top:13px;">
                            <div class="seven wide field required">
                                <label class="label_fl">发票抬头</label>
                                <input type="text" name="title" ng-model="invoice_title" placeholder="请填写发票抬头" style="width:240px" >
                            </div>
                            <div class="one wide field"></div>
                            <div class="inline eight wide field" id="payeeID">
                                <label>收款单位</label>
                                <div class="ui selection dropdown" ng-model="payee" style="width:285px;">
                                    <input type="hidden" name="payee">
                                    <i class="dropdown icon"></i>
                                    <div class="default text">请选择收款单位</div>
                                    <div class="menu">
                                        <div class="item" data-value="{{sel.k}}"  ng-repeat="sel in payeetypes">{{sel.v}}</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="three fields">
                            <div class="seven wide field required">
                                <label class="label_fl">开票金额</label>
                                <input type="text" name="money" ng-model="invoice_money" ng-keyup="setTax()" placeholder="请填写开票金额" style="width:240px">
                            </div>
                            <div class="one wide field"></div>
                            <div class="inline eight wide field" style="line-height: 32px;">
                                <label style="margin-right: 0.5em">税率</label>
                                <span style="margin-left: 0.5em">6%</span>
                                <label style="margin-left: 6em">税额</label>
                                <span style="margin-left: 0.5em">{{invoice_tax}}</span>
                            </div>
                        </div>
                        <div class="field">
                            <div class="field">
                                <label class="label_fl">备注</label>
                                <input type="text" name="remark" placeholder="请填写备注信息" style="width:81%; margin-left: 2.2em">
                            </div>
                        </div>
                    </form>
                </div>
                <!-- 添加专票信息  -->
                <div class="type" ng-show="invoicetype == 2">
                    <form action="#" name="frm-imgPost" id="frm-imgPost">
                        <div class="ui form" style="min-height: 270px;">
                            <div class="fields" style="margin-top:13px;">
                                <div class="seven wide field required">
                                    <label class="label_fl">发票抬头</label>
                                    <input type="text" name="imgPost_title" ng-model="imgPost_title" placeholder="请填写发票抬头" style="width:240px">
                                </div>
                                <div class="one wide field"></div>
                                <div class="seven wide field required">
                                    <label class="label_fl">开票金额</label>
                                    <input type="text" name="imgPost_money" ng-model="imgPost_money" ng-keyup="imgPost_tax()" placeholder="请填写开票金额" style="width:240px">
                                </div>
                            </div>
                            <div class="fields">
                                <div class="inline three wide field">
                                    <label>税率</label>
                                    <span style="margin-left: 0.5em">6%</span>
                                </div>
                                <div class="inline three wide field">
                                    <label>税额</label>
                                    <span style="margin-left: 1em">{{imgPost_taxs}}</span>
                                </div>
                            </div>
                            <span style="font-weight:bold;">提示：最多可以添加6张图片！</span>
                            <div class="inline fluid field PicDiv">
                                <div ng-repeat="img in imgAdd" class="fl" style="margin: 0">
                                    <div class="add_img fl">
                                        <img ng-src="{{img.path}}" width="108px" height="108px"/>
                                        <div class="x_icon" ng-click="delImg()"></div>
                                    </div>
                                </div>
                                <div class="add_btn fl"><img src="dist/images/add.png" width="108px" height="108px" ng-change="addChange(addPic)" ng-model="addPic" ngf-select/></div>
                                <div class="inline field pt10" style="padding: 5px">
                                    <label>图片说明</label>
                                    <input type="text" name="pic_alt" ng-model="pic_alt" placeholder="请填写图片内容说明" style="width: calc(100% - 80px)">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="inline fields" style="margin-top:15px;">
                    <div class="field required">
                        <label>请选择邮寄情况</label>
                    </div>
                    <div class="field">
                        <div class="ui radio checkbox">
                            <input name="frequency2" checked="checked" type="radio" ng-click="deliveType(1)">
                            <label>发票邮寄</label>
                        </div>
                    </div>
                    <div class="field" style="margin-left: 50px;">
                        <div class="ui radio checkbox">
                            <input name="frequency2" type="radio" ng-click="deliveType(2)">
                            <label>发票自取</label>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <div id="add_sty"></div>
                </div>
                <!-- 添加邮寄信息  -->
                <div class="type" ng-show="delivetype == 1" style="min-height: 120px;">
                    <form action="#" name="delivery-add" id="delivery-add">
                        <input type="hidden" ng-model="delivery_id">
                        <div class="fields" style="margin-top:13px;">
                            <div class="seven wide field required">
                                <label class="label_fl" style="margin-right: 0.4em">收件人</label>
                                <input type="text" name="recipients" ng-model="ssss" style="width:240px;" placeholder="请填写收件人">
                            </div>
                            <div class="one wide field"></div>
                            <div class="seven wide field">
                                <label class="label_fl">收件地址</label>
                                <input type="text" name="address" ng-model="customer_address" style="width:240px;" placeholder="请填写收件人地址">
                            </div>
                        </div>
                        <div class="fields">
                            <div class="seven wide field">
                               <label class="label_fl" style="margin-right: 1em">手机号</label>
                                <input type="text" name="phone" style="width:240px;" ng-model="customer_phone" placeholder="请填写收件人手机号">
                            </div>
                            <div class="one wide field"></div>
                            <div class="inline field">
                                <label>创建时间</label>
                                <div class="ui left icon input" style="width:240px;">
                                    <input name="send_time" placeholder="创建时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value="">
                                    <i class="calendar icon"></i>
                                </div>
                            </div>
                        </div>
                        <div class="field">
                            <label class="label_fl">备注</label>
                            <input type="text" name="remark" placeholder="请填写备注信息" style="width:77%; margin-left: 1.8em">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="actions" style="text-align: center;">
        <button class="ui green button positive">确定</button>
        <button class="ui grey button negative">取消</button>
    </div>
</div>
<!--添加成功-->
<div class="ui small modal addInvOk" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">添加成功</p>
    </div>
</div>
<!--添加失败-->
<div class="ui modal addInvFail" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge red warning outline icon"></i>
        <p style="padding-top: 15px;">添加失败</p>
    </div>
</div>
<!--图片上传失败-->
<div class="ui modal postFail" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge red warning outline icon"></i>
        <p style="padding-top: 15px;">图片上传失败</p>
    </div>
</div>
<!--*******************************添加发票功能end****************************************************-->

<!--成功弹窗-->
<div class="ui small modal modal1 time" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">{{msg}}</p>
    </div>
</div>
<!--失败-->
<div class="ui modal modal2 time" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content"> 
        <i class="huge red warning  outline icon "></i>
        <p style="padding-top: 15px;">{{msg}} </p>
    </div>
</div>
 <!--弹框结束-->
<script type="text/javascript">
    $(function(){
         $('.ui.dropdown').dropdown();
    });
</script>